package com.settlement.system.service.impl;

import com.settlement.system.mapper.TblReceiveRefundEditorMapper;
import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblReceiveRefundEditor;
import com.settlement.system.service.ITblReceiveRefundEditorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.settlement.system.mapper.BaseMapper;
import jakarta.annotation.Resource;

/**
 * 收退款-制单人 服务实现类
 * @author Ximi
 * @since 2020-06-18
 */
@Slf4j
@Service
public class TblReceiveRefundEditorServiceImpl extends BaseServiceImpl implements ITblReceiveRefundEditorService {

    @Resource
    private TblReceiveRefundEditorMapper tblReceiveRefundEditorMapper;

    @Override
    public BaseMapper init() {
        return tblReceiveRefundEditorMapper;
    }

    @Override
    public TblReceiveRefundEditor getEditorByLoginName(String loginName) throws ServiceException {
        try {
            return tblReceiveRefundEditorMapper.getEditorByLoginName(loginName);
        } catch (Exception ex){
            log.error("通过登录名,获取制单人异常",ex);
            throw new ServiceException("通过登录名,获取制单人异常",ex);
        }
    }

    @Override
    public TblReceiveRefundEditor getEditorByEditorName(String loginName) throws ServiceException {
        try {
            return tblReceiveRefundEditorMapper.getEditorByLoginName(loginName);
        } catch (Exception ex){
            log.error("通过登录名,获取制单人异常",ex);
            throw new ServiceException("通过登录名,获取制单人异常",ex);
        }
    }
}

